import axios from 'axios';

const baseURL = '/api';

/**
 * 上传图片文件
 * @param {File} file 图片文件
 * @returns {Promise<string>} 图片访问URL
 */
export function uploadImage(file) {
  const formData = new FormData();
  formData.append('file', file);
  
  return axios({
    url: `${baseURL}/file/upload/image`,
    method: 'post',
    data: formData,
    headers: {
      'Content-Type': 'multipart/form-data'
    }
  });
} 